#! /usr/bin/python
# -*- coding: utf-8 -*-

from @Package@.action import @PROTO_PY@

import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct

class @Class@(genpy.Message):
  _md5sum = "@Checksum@"
  _type = "@Package@/@Class@"
  _has_header = False
  _full_text = "Protobuf generated msg for @Package@::@Class@"
  __slots__ = ['pb']
  _slot_types = ['@Package@/@PROTO_PY@/@Class@']

  def __init__(self, *args, **kwds):
    if args or kwds:
      super(@Class@, self).__init__(*args, **kwds)
      if self.pb is None:
         self.pb = @PROTO_PY@.@Class@()
    else:
       self.pb = @PROTO_PY@.@Class@()

  def _get_types(self):
    return self._slot_types

  def SerializeToString(self):
    return self.pb.SerializeToString()
  
  def ParseFromString(self,buff):
    return self.pb.ParseFromString(buff)

  def serialize(self, buff):
    try:      
      buff.write( self.pb.SerializeToString())
    except struct.error as se:
      self._check_types(
          struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get(
              '_x', self)))))
    except TypeError as te:
      self._check_types(
          ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get(
              '_x', self)))))

  def deserialize(self, str):
    try:
      self.pb = @PROTO_PY@.@Class@()
      self.pb.ParseFromString(str)
      
      return self
    except struct.error as e:
      raise genpy.DeserializationError(e)

  def serialize_numpy(self, buff, numpy):
    self.serialize(buff)

  def deserialize_numpy(self, str, numpy):
    self.deserialize(str)
    return self